(() => {
  let ele = {};
  ele.myFer = $("#myFer");
  ele.paihang = $("#paihang");
  ele.qiege_L = $("#qiege_L");
  ele.todayMonry = $("#todayMonry");
  ele.myFenter = $("#myFenter");
  ele.zongMonry = $("#zongMonry");
  ele.fenxang = $("#fenxang");
  let detail = {};
  //   点击跳转到我的好友也妙女
  ele.myFer.onclick = () => {
    location.href = "../page/mine_invite.html";
  };
  //   点击排行榜
  ele.paihang.onclick = () => {
    location.href = "../page/mine_pai.html";
  };
  // 点击好友切割
  ele.qiege_L.onclick = () => {
    location.href = "../page/mine_qie.html";
  };
  // 点击分享
  ele.fenxang.onclick = () => {
    location.href = "../page/inviteFriend.html";
  };
  qiegejl();
  // !请求数据
  function qiegejl() {
    let token = getCookie("token");
    ajax({
      method: "get",
      url: API_PATH.QIEGEDETAIL,
      header: {
        Authorization: token,
      },
      success: (res) => {
        detail = res.data.detail;
        initList();
      },

      error: (err) => {
        // openTips(err.msg);
      },
    });
  }
  // !渲染数据
  function initList() {
    ele.myFer.innerHTML = `我的好友: ${detail.friend_num} 人 >`;
    ele.zongMonry.innerHTML = detail.all_money;
    ele.todayMonry.innerHTML = detail.today_money;
    ele.myFenter.innerHTML = detail.has_money + "个";
  }
})();
